list_nums = [1, 4, 7, 14, 18, 0, 6, 8]
state = False
for r in range(len(list_nums) - 1):
    cur_num = list_nums[r]
    for c in range(r + 1, len(list_nums), 1):
        next_num = list_nums[c]
        if cur_num == next_num:
            state = True
            print('列表存在相同元素%d=%d' % (cur_num, next_num))

if not state:
    print('没有相同元素')
